home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / cbm / 1164 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  4.1 KB

  1. Path: f411.n201!not-for-mail
  2. Newsgroups: comp.sys.cbm
  3. X-Comment-To: xxxxx@xxxxx.com
  4. From: Pontus Berg <Pontus.Berg@p71.anet.canit.se>
  5. Date: Wed, 24 Jan 96 01:29:41 +0100
  6. Subject: How did they do that?
  7. Message-ID: <822468144@p71.f411.n201.z2.ftn>
  8. References: <1298829101@xxxxx.com>
  9. Organization: BoArDgasm, Farsta, Sweden
  10. X-FTN-AREA: CANIT_COMP_SYS_CBM
  11. X-FTN-MSGID: 2:201/411.71 3105de30
  12. X-FTN-REPLY: xxxxx.com 4d6a8f2d
  13. X-FTN-CHRS: IBMPC 2
  14. X-FTN-Tearline: Spot 1.3a #676
  15. X-FTN-Origin: BoArDgasm, Farsta, Sweden (2:201/411.71)
  16. X-FTN-SEEN-BY: 201/411 
  17. X-FTN-PATH: 201/411 
  18. X-FTN-PATH: 201/411
  19.  
  20. In a message of 22 Jan 96 xxxxx@xxxxx.com wrote to All:
  21.  
  22.  xxc> It is possible to show multiples of 8 sprites at once by splitting the
  23.  xxc> screen up by raster interrupts. This is also how they put a text
  24.  xxc> screen  at the bottom of a graphics screen in some adventure games. I
  25.  xxc> don't know  the specifics, (tho I have the ML routines somewhere if u
  26.  xxc> want them) but  I suspect this is how they did it. I have seen as many
  27.  xxc> as 64 sprites  onscreen at once, but it is very flickery.
  28.  
  29. I could EASILY do 8*as many as you can fit in Y-direction as long as I don't
  30. have to move them in Y-direction and this of course without flickering!
  31.  
  32. Sprites are handy in lots of aspects (though some of the features are
  33. disadvantages in other aspects). You could f.ex. place the sprites and then give
  34. them a new Y value and they would still be fully plotted on the original
  35. position if as much as the first row of them has been plotted.
  36.  
  37. Say f.ex. you wanted to plot lots of sprites and you started in position $20;
  38. You placed the sprites on rasterline $20(32). On the following line ($21) you
  39. could move the Y position of the sprites to row to $35 (32+21). You could do it
  40. on row $20 as well if you just made sure you have begun the plot of the sprite
  41. first! Then you get two set of sprites fitting top to bottom with NO flicker.
  42. Make sure you replace them at row $20 afterwars. Now you can just fill in the
  43. rest yourself by placing the next bunch on row $4a (32+21+21), $5f and so on
  44. till you filled the screen!
  45.  
  46. One thing; If you are to do the easy way out by polling $D012 between, just
  47. make sure you handle the "bad lines" correctly with a check that would catch up
  48. even if you fail to deliver a compare on the exact line. This is also a problem
  49. when $d012 warps. (Don't know what happens to my routine round raster $100 i.e
  50. $D011 MSB set and $D012 = $00)
  51.  
  52. I included an approach, written first time as it stands here in the mail so I
  53. will probably not work... ;-) You'd have to do a bit of setup of all values for
  54. the sprites (but the Y values as they are set in the loop anyway!). It of course
  55. asumed that the sprites are not Y expanded. I get the calculation to that you'd
  56. bee able to fit some 15 * 8 sprites (120!) without flickering here. You'd have
  57. to open the uper and lower border. You'd need to add border opening in the loop
  58. (which I won't do without testing it) to get the size to show them! (No point in
  59. having lots of sprites UNDER the border, now is there? ;-)
  60.  
  61. The routine looks like garbage, but it will probably do it's job... It steals
  62. all the rastertime and uses 98% for polling $d012 but I'l leave to you to
  63. improve it!
  64.  
  65.  
  66. poll    lda $d011       ;Wait untill the top of the screen!
  67.         bmi poll
  68.  
  69. start   ldx #$00
  70. loop    lda table,x
  71.         sta $d001       ;The sprites X-positions!
  72.         sta $d003
  73.         sta $d005
  74.         sta $d007
  75.         sta $d009
  76.         sta $d00b
  77.         sta $d00d
  78.         sta $d00f
  79.         tay             ;Use table value to compare with
  80.         iny             ;but tablevalue+1 - see the text above! loop2   cpy
  81. $D012
  82.         bne loop2       ;could be BPL, BCC or something I never get right ;-)
  83.                         ;to make CERTAIN it doesn't fall trhough on
  84.                         ;a "BAD-line"
  85.         inx
  86.         cpx #$(number of spriterows, also number of values in table)
  87.         bne start       ; could be poll!
  88.  
  89. table   .byte $20,$35,$4a,$5f ; and on you go
  90.  
  91.  
  92.  
  93. /Pontus Berg, Bacchus@FairLight.COM
  94.  
  95. ... The C64 is my only religion!
  96.     It's for real and can be proven and it's for sure devine!
  97.     (Pontus Berg)
  98.